package com.starlink.client.ras.response;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Objects;

@Data
public class RasBaseResponse<T> implements Serializable {

        private static final long serialVersionUID = -636301797303418L;
        public static final String STATUS_SUCCESS = "success";
        public static final String MSG_SUCCESS = "操作成功";
        public static final int SUC_CODE = 200;

        @ApiModelProperty("响应码: 200成功")
        private Integer code;
        @ApiModelProperty("响应消息")
        private String msg;
        @ApiModelProperty("响应数据")
        private T data;
        public boolean isSuc() {
            return Objects.nonNull(code) && code == SUC_CODE;
        }

        public boolean isBizSuc() {
            return Objects.nonNull(msg) && Objects.equals(msg, MSG_SUCCESS);
        }

}


